package com.taxi.controller;

import com.taxi.request.AdminUser;
import com.taxi.result.Result;
import com.taxi.service.AdminUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/user")
public class AdminController {

    @Autowired
    private AdminUserService adminUserService;
    @PostMapping("/login")
    public Result login(@RequestBody AdminUser user){
        return adminUserService.login(user);
    }

    @GetMapping("/info")
    public Result getInfo(@RequestParam String token) {
        return adminUserService.getInfo(token);
    }

    @PostMapping("/logout")
    public Result logout(){
        return Result.ok();
    }
}
